package org.robustcoupe.task.example;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.robustcoupe.task.example.resources.LoggingFailoverTask;
import org.robustcoupe.task.example.resources.ToBeFailedTask;
import static org.robustcoupe.task.NestedFunctionStyle.*;

public class RetryFailoverDecoratorExample {
  static final Log LOG = LogFactory.getLog(RetryFailoverDecoratorExample.class);

  public static void main(String[] args) throws Exception {
    new ToBeFailedTask()
      .wrappedByRetryFailover()
        .failover(new LoggingFailoverTask())
        .retryCount(3)
      .execute();
    
    retryFailOver(
        task(new ToBeFailedTask()),
        failover(new LoggingFailoverTask()),
        retryCount(3)
    ).execute();
  }
}
